package Thread;

public class ThreadInfoDemo {
    public static void main(String[] args) {


        Thread main = Thread.currentThread();//主线程获取
        String name = main.getName();//获取线程名字
        System.out.println("名字："+name);//main

        long id = main.getId();//获取ID,唯一标识
        System.out.println("唯一标识："+id);

        int priority = main.getPriority();//获取优先级
        System.out.println("优先级："+priority);

        boolean isAlive = main.isAlive();
        System.out.println("是否还活着："+isAlive);

        boolean isDaemon = main.isDaemon();
        System.out.println("是否为守护线程："+isDaemon);

        boolean isInterrupted = main.isInterrupted();//是否被中断
        System.out.println("是否被中断了："+isInterrupted);


    }
}
